<?php
/* @var $this ProductController */
/* @var $model Product */
/* @var $form CActiveForm */
?>
<script type="text/javascript">
<!--
seajs.use('src/manage/product', function (product) {
	
})
//-->
</script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-form',
	'enableAjaxValidation'=>true,
	'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); 
CHtml::$beforeRequiredLabel = '';
CHtml::$afterRequiredLabel = ' <span class="required">*</span>';
?>
	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'name',array('class'=>'alert alert-error')); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'price'); ?>
		<?php echo $form->textField($model,'price',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'price',array('class'=>'alert alert-error')); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'category_id'); ?>
		<?php echo $form->dropDownList($model,'category_id',Category::model()->getCategories());?>
		<?php echo $form->error($model,'category_id',array('class'=>'alert alert-error')); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'cover_image'); ?>
		<?php echo $form->fileField($model,'cover_image');?>
		<?php echo $form->error($model,'cover_image',array('class'=>'alert alert-error')); ?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '更新'); ?>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->